<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jstl/core"
                template="/template_content_admin.xhtml">

  <ui:define name="conteudo">
    <h2>#{msg['novo_cardapio']}</h2>
    <h:panelGroup id="messagePanel" layout="block">
            <h:messages errorClass="messagesErro" infoClass="messagesInfo" layout="table"/>
    </h:panelGroup>
    <h:form>
       <h:panelGrid columns="2" columnClasses="panelgridClass1, panelgridClass2">
            <f:facet name="header">
                <h:outputText value="Hmmmmm!"/>
            </f:facet>
                    <h:outputText value="#{msg['nome_prato']}:"/>
                    <h:inputText styleClass="try" id="produto" value="#{cardapio.cardapio.produto}" required="true" requiredMessage="The produto field is required." />
                    <h:outputText value="#{msg['descricao']}:"/>
                    <h:inputTextarea styleClass="try" rows="4" cols="30" id="descricao" value="#{cardapio.cardapio.descricao}" title="Descricao" />
                    <h:outputText value="#{msg['preco']}:"/>
                    <h:inputText styleClass="try" id="preco" value="#{cardapio.cardapio.preco}" title="Preco" required="true" requiredMessage="The preco field is required." />
                    <h:outputText value="#{msg['semanal']}:"/>
                    <h:selectBooleanCheckbox id="semanal" value="#{cardapio.cardapio.semanal}" title="semanal" />
                    <h:outputText value="#{msg['diaSemana']}:"/>
                    <h:selectOneMenu value="#{cardapio.cardapio.diaSemana}" id="patente">
                        <f:selectItem itemLabel="-------" itemValue="" />
                        <f:selectItem itemLabel="Domingo" itemValue="dom" />
                        <f:selectItem itemLabel="Segunda" itemValue="seg"/>
                        <f:selectItem itemLabel="Terça" itemValue="ter"/>
                        <f:selectItem itemLabel="Quarta" itemValue="qua"/>
                        <f:selectItem itemLabel="Quinta" itemValue="qui"/>
                        <f:selectItem itemLabel="Sexta" itemValue="sex"/>
                        <f:selectItem itemLabel="Sábado" itemValue="sab"/>
                    </h:selectOneMenu>  
                    <h:outputText value="#{msg['ingredientes']}:"/>

                    <h:selectManyListbox value="#{cardapio.cardapio.ingredientesCollection}">
                        <c:forEach items="#{ingrediente.listIngredientes}" var="item">
                            <f:selectItem itemValue="#{item.id}" itemLabel="#{item.nome}"/>
                            <f:converter converterId ="converterIngredientes" />
                        </c:forEach>
                    </h:selectManyListbox>
                </h:panelGrid>
                <h:panelGrid columns="2">
                    <h:commandButton id="add" styleClass="buttonK" value="#{msg['adicionar']}" action="#{cardapio.create}"/>
                    <h:commandButton id="list" styleClass="buttonK" value="#{msg['listar']}" action="#{cardapio.listarCardapio}" immediate="true"/>
                </h:panelGrid>
    </h:form>
    </ui:define>

</ui:composition>
